import request from '@/utils/request'
import { rsaEncrypt } from '@/utils/commonUtil3'
import qs from 'qs'

// 获取分录中心订单列表
export function getSelectStoreEntries(data) {
  return request({
    url: '/store/selectStoreEntries',
    method: 'get',
    params: data
  })
}
// 分录导出
export function exportOrder(data){
  return request({
		url: '/storeRequire/exportStoreRequire',
		responseType: 'blob',
		method: 'POST',
		data
	});
}
// 获取仓库信息列表
export function getWarehouseList(data) {
  return request({
    url: '/warehouse/selectWarehouse',
    method: 'get',
    params: data
  })
}

// 根据门店id查询点采订单
export function getStorePickUpOrder(data) {
  return request({
    url: '/storePick/selectEntriesPickOrder',
    method: 'get',
    params: data
  })
}

// 获取点采订单详情
export function getStorePickUpOrderDetail(data) {
  return request({
    url: '/storePick/select',
    method: 'get',
    params: data
  })
}

// 添加要货单信息
export function addStorePickUpOrder(params) {
  // const data1 = rsaEncrypt(data)
  return request({
    url: '/storeRequire/selectStoreRequire?' + qs.stringify(params, { arrayFormat: 'repeat' }),
    method: 'get'
    // params: data
  })
}

// 分录
export function definiteEntry(data) {
  const data1 = rsaEncrypt(data)
  return request({
    url: '/storeRequire/insert',
    method: 'post',
    data: {
      data: data1
    }
  })
}

// 分页条件查询要货订单列表
export function getStoreRequireList(data) {
  return request({
    url: '/storeRequire/select',
    method: 'get',
    params: data
  })
}

//  查看要货项列表
export function getStoreDetailRequireList(data) {
  return request({
    url: '/storeRequire/selectStoreRequireList',
    method: 'get',
    params: data
  })
}
